package com.central.dataManage.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.central.common.enums.PrivilegeType;
import com.central.common.handler.ListPrivilegeToStringHandler;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import static com.baomidou.mybatisplus.annotation.FieldStrategy.NOT_NULL;

/**
 * @author Tindy
 * @date 2021/7/5
 * @describe
 */
@Setter
@Getter
@AllArgsConstructor
@TableName(value = "user_table_privilege",autoResultMap = true)
public class UserTablePrivilege implements Serializable{
    private Long datasourceId;
    private String dbName;
    private String tableName;
    private Long proId;
    private String proName;
    private Long userId;
    private String username;
    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = NOT_NULL, typeHandler = ListPrivilegeToStringHandler.class)
    private List<PrivilegeType> privilege;
}
